@echo off
setlocal ENABLEDELAYEDEXPANSION
if %PROCESSOR_ARCHITECTURE%==x86 (
 set xdelta_bin=xdelta3-32.exe
) else (
 set xdelta_bin=xdelta3-64.exe
)



set DIFF=KoFKyo13-12.vcdiff
set V1=KOF_KYO.bin
set V2=KOF_KYO Hack Esp.bin
echo.
echo.Patching "%V1%"...
%xdelta_bin% -d -s "%V1%" "%DIFF%" "%V2%"
if %ERRORLEVEL% EQU 0 (
 if EXIST "%V2%" (
  echo Returned 0. Patching successful. "%V1%" can be deleted if "%V2%" works correctly.
 ) else (
  echo Returned 0. Patching failed. Unknown error.
 )
) else (
 echo Returned %ERRORLEVEL%. Patching failed.
)



pause